package com.example.wxy.bbtapp.DeviceService;

import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.PowerManager;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by yons on 2017/9/5.
 */

public class ScreenManager {
    public static boolean getScreenInfo(Context context)
    {
        PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
//true为打开，false为关闭
        boolean ifOpen = powerManager.isScreenOn();
        return ifOpen;
    }



    /**
     * 判断当前界面是否是桌面
     */
    public static boolean isHome(Context c) {

        return AppMonitorService.getHomes(c).contains(AppMonitorService.getTopActivy(c));
    }
}
